%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/polymorphic/returns-setof"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 8, 9, 17, 10<br />2: PgSelect[12]<br />3: PgSelectRows[14]<br />ᐳ: 13, 15, 16"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 17, 16<br /><br />ROOT Constantᐸ[HIDDEN]ᐳ[17]"):::bucket
    end
    Bucket0 --> Bucket1

    %% plan dependencies
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    PgSelect12[["PgSelect[12∈0] ➊<br />ᐸall_single_tables(aggregate)ᐳ"]]:::plan
    Object10 --> PgSelect12
    First13{{"First[13∈0] ➊"}}:::plan
    PgSelectRows14[["PgSelectRows[14∈0] ➊"]]:::plan
    PgSelectRows14 --> First13
    PgSelect12 --> PgSelectRows14
    PgSelectSingle15{{"PgSelectSingle[15∈0] ➊<br />ᐸall_single_tablesᐳ"}}:::plan
    First13 --> PgSelectSingle15

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,Access8,Access9,Object10,PgSelect12,First13,PgSelectRows14,PgSelectSingle15 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1

